Use a dedicated ActiveSupport::Deprecation instance#2479
Use a dedicated ActiveSupport::Deprecation instance#2479nickcharlton merged 4 commits intothoughtbot:mainfrom
Conversation
Rails 7.1 started deprecating the direct usage of ActiveSupport::Deprecate methods. Instead, the preferred way is to instantiate the class and use the custom instance. Compatible with Rails 4.0+
ad02038 to
7c3f6c4
Compare
|
Nice, thanks! |
|
Ah, hmm. I tried this out just to see if we'd missed a few, and it seems like we did. I pushed a commit with those, which I caught, but I'm also getting these: (It might be best to run with I am partial to ignoring it as there's no direct calls, but I'll have another look tomorrow. |
|
Hey @nickcharlton thanks a ton, I've missed it, will take a better look at it during the weekend. |
|
Cool, thanks! Let me know how you get on, but I'll leave this with you until I hear otherwise! |
Deprecations fixed: - RSpec exist deprecated matcher - Rails 7 cache version deprecation
|
Hey @nickcharlton, I think I've addressed all the remaining deprecation warnings. One type was coming from RSpec and the usage of a deprecated file exists matcher, another one was about using an old Rails cache format, I've modified the test.rb of the example app to use the new format in Rails 7+. Please take a look when you have a moment, thanks. |
|
Excellent, thanks! This looks good to me now and I'm not seeing any deprecation warnings now so I'm going to merge it. |
In thoughtbot#2479, we switched to using a dedicated `ActiveSupport::Deprecation` instance to handle a deprecation warning. Unfortunately, in some circumstances, we reference the `VERSION` constant when it's not been loaded, which seems to happen when we render the deprecation warnings.
In #2479, we switched to using a dedicated `ActiveSupport::Deprecation` instance to handle a deprecation warning. Unfortunately, in some circumstances, we reference the `VERSION` constant when it's not been loaded, which seems to happen when we render the deprecation warnings.
Description
Rails 7.1 started deprecating the direct usage of
ActiveSupport::Deprecationmethods. Instead, the preferred way is to instantiate the class and use the custom instance.This PR adds the deprecator instance and switches the warn calls to use it.
Compatible with Rails 4.0+
Deprecation example
Each deprecation originating from Administrate is accompanied by a Rails 7.1 deprecation.